﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Forum.DataAccess.DbModel;

namespace Forum.Domain.Managers
{
    public class CategoryManager : ManagerBase
    {
        public Category GetCategory(int id)
        {
            return (from c in DbContext.Categories
                    where c.Id == id
                    select c).SingleOrDefault();
        }

        public void CreateCategory(Category category)
        {
            DbContext.Categories.AddObject(category);
            DbContext.SaveChanges();
        }
    }
}
